$OpenBSD: patch-src_ipaudit_c,v 1.3 2016/03/17 19:52:40 naddy Exp $
--- src/ipaudit.c.orig	Thu Jan 25 22:04:00 2001
+++ src/ipaudit.c	Thu Mar 17 17:34:39 2016
@@ -40,6 +40,9 @@ Include Files
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <errno.h>
 #include <string.h>
 #include <pcap.h>
 #include <signal.h>
@@ -50,7 +53,13 @@ Include Files
 #include <netinet/in.h>
 #include "hash.h"
 
+#ifdef DLT_PFLOG
+#include <net/if_pflog.h>
+#endif
 
+#ifdef DLT_ENC
+#include <net/if_enc.h>
+#endif
 
 /*
 ------------------------------------------------------------------------
@@ -217,7 +226,6 @@ typedef struct {
 Global variables
 ------------------------------------------------------------------------
 */
-extern int errno;
 extern char pcap_version[];
 
 
@@ -434,6 +442,16 @@ if (debug_m) {
 				printf ("DataLinkType = %s\n", "DLT_RAW"); break;
 			case DLT_ATM_RFC1483: 
 				printf ("DataLinkType = %s\n", "DLT_ATM_RFC1483"); break;
+			case DLT_LOOP:
+				printf ("DataLinkType = %s\n", "DLT_LOOP"); break;
+			case DLT_ENC:
+				printf ("DataLinkType = %s\n", "DLT_ENC"); break;
+			case DLT_PPP_ETHER: 
+				printf ("DataLinkType = %s\n", "DLT_PPP_ETHER"); break;
+			case DLT_PFLOG: 
+				printf ("DataLinkType = %s\n", "DLT_PFLOG"); break;
+			case DLT_PFSYNC: 
+				printf ("DataLinkType = %s\n", "DLT_PFSYNC"); break;
 			default:
 				printf ("DataLinkType = %d\n", DataLinkType);
 		}
@@ -1278,6 +1296,19 @@ int get_packetoffset (int DataLinkType) {
 		case DLT_NULL:
 			PacketOffset = POFF_NULL;
 			break;
+		case DLT_LOOP:
+		case DLT_PFSYNC:
+			PacketOffset = 4;
+			break;
+		case DLT_PPP_ETHER:
+			PacketOffset = 8;
+			break;
+		case DLT_ENC:
+			PacketOffset = ENC_HDRLEN;
+                        break;
+		case DLT_PFLOG:
+			PacketOffset = PFLOG_HDRLEN;
+                        break;
 		/*  Currently only know ethernet, ppp, for others we guess  */
 		default:
 			PacketOffset = 0;
